<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.team.util.Const"  %>
<%@ page import="com.team.entity.User"  %>
<%@ page import="com.team.entity.Project"  %>
<%@ page import="com.team.util.ObjectUtil" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>项目设置</title>
	   <link rel="stylesheet" href="css/prettify.css" />
    <link rel="stylesheet" href="css/bootstrap.min.css" />
  
</head>
<body class="body">

<% 
	User user = (User)session.getAttribute(Const.SESSION_USER); 
	Project proj =(Project)session.getAttribute(Const.SESSION_PROJ);
	if(ObjectUtil.isEmpty(user)||ObjectUtil.isEmpty(proj)){
 %>
 <div style="color:red;">user or project is null</div>
 <%}else { %>
	<div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a href="#" class="brand">凯盛项目管理系统</a>
				 <ul class="nav pull-right">
						<li><a class="nav pull-right" href="#">用户名： <%=user.getUsername() %></a></li>
				 </ul>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">

				
			<div class="span3">
			<div class="well" style="padding: 8px 0;">
						<ul class="nav nav-list">
						  <li class="nav-header"><%=proj.getProjName() %></li>
						  
						  <li ><a href="newState.jsp"><i class="icon-home"></i>最新动态</a></li>
						  <li><a href="goal.jsp"><i class="icon-flag"></i>目标</a></li>
						  <li ><a href="docShare.jspx?_m=select&projId=<%=proj.getId() %>"><i class="icon-folder-open"></i>资料库</a></li>
						  <li><a href="newFolder.jspx?_m=select"><i class="icon-file"></i>文件共享</a></li>
						  <li><a href="newContact.jspx?_m=select&projId=<%=proj.getId() %>"><i class="icon-user"></i>联系人</a></li>
						  <li><a href="newIdea.jspx?_m=select&id=<%=proj.getId() %>"><i class="icon-fire"></i>想法</a></li>
						  <li ><a href="findBug.jsp"><i class="icon-warning-sign"></i>Bug</a></li>
						  <li class="active"><a href="projReset.jsp"><i class="icon-white icon-cog"></i>项目设置</a></li>
						</ul>
					</div>

				</div>
			<%} %>	
			
            <div class="span9">
           	<c:choose>
			<c:when test="${param.code=='1001'}">
				<div style="color:red;">内容不可以为空</div>
			</c:when>
			
		</c:choose>
           	<%
           		 List<User> userList = ( List<User>)session.getAttribute(Const.SESSION_RESET_MEMBERLIST);
           		 Project project =(Project)session.getAttribute(Const.SESSION_RESET_PROJ);

           		if(ObjectUtil.isEmpty(project)||ObjectUtil.isEmpty(userList)){
           			response.sendRedirect("listProj.jsp?code=1005");
           			return ;
           		}else {
	           		String str ="";
	           		for(User tempUser:userList){
	           			str += tempUser.getUserName()+";";
	           			System.out.println("str→"+str);
           			}
           	 %>
           	 
			<form class="well,form-horizontal" action = "newProj.jspx?_m=update&projId=<%=project.getId() %>" method="post">
				<fieldset>
				<div class="controls">
					 <label>项目名称</label>
						<input type="text" value=<%=project.getProjName()%> name="projname" />
					<p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p>
				</div>
				<div class="controls">
					<label>负责人</label>
					<div class="controls">
						 
						<input name="leader" value="<%=user.getUserName() %>"/>
						
					</div>
				</div>
				<div class="controls">
					<label>项目成员</label>
					<input  type="text" value=<%=str%>  name="member" />
				</div>
		        <div class="controls">
					<label>项目创建时间</label>
					<input value=<%=project.getCreateTime() %>  name= "time" type="text" />
				</div>
				<div class="controls">
				   <label>项目简介</label>
				   <textarea  name="text"  rows="3" id="textarea" class="input-xlarge"><%=project.getContent() %> </textarea>
				</div>
				<div class="controls">
					  <label>项目截止时间</label>
					  <input value=<%=project.getEndTime() %>  name = "endtime" type="text" /><br/>
				</div>
		       <%} %>
		       
		       
		       <div class="form-actions">
					 <button href="#" class="btn btn-primary">保存</button>
					<a href="listProj.jsp" class="btn btn-primary">取消</a>
			   </div>
			   </fieldset>
			</form> 
			
			</div>
      	
		</div>
 	</div>
 	
  	
</body>
</html>